package com.boot.dao;

import com.boot.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 账户管理dao
 */
@Repository
@Mapper
public interface AccountManagementDao {

    //↓用户相关
    List<User> findAllUser();

    List<User> findAllUser(String key);

    int findUserCount();

    int findUserCount(String key);

    int delUser(int id);

    User findUserById(int id);

    int updateUser(User user);

    int addUser(User user);

    User findUserByUserName(String username);


    //↓公司相关
    String findCompanyNameById(Integer id);

    String findDepartmentNameById(Integer id);

    Company findCompanyById(int id);

    List<Company> findAllCompany();

    List<Department> findAllDepartment();


    //↓采购申请相关
    int nextPurchapplyID();

    int addPurchapply(Purchapply purchapply);

    int addPurchapplyDetail(PurchapplyDetail purchapplyDetail);

    int addCoalQuality(CoalQuality coalQuality);



    List<PurchapplyDetail> findPurchapplyDetailByCompanyId(int company_id);

    int findPurchapplyDetailCountByCompanyId(int company_id);

    Purchapply findPurchapplyById(int id);

    PurchapplyDetail findPurchapplyDetailById(int purchapply_id);

    CoalQuality findCoalQualityById(int purchapply_id);



    int modifyPurchapply(Purchapply purchapply);

    int modifyPurchapplyDetail(PurchapplyDetail purchapplyDetail);

    int modifyCoalQuality(CoalQuality coalQuality);



    int deletePurchapply(int purchapply_id);

    int deletePurchapplyDetail(int purchapply_id);

    int deleteCoalQuality(int purchapply_id);
}
